home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / install < prev    next >
Encoding:
Text File  |  2001-02-08  |  20.0 KB  |  538 lines

  1. This file was generated automatically from install.texi.
  2. DO NOT CHANGE THIS FILE MANUALLY!
  3.  
  4. Installing GNU Pascal
  5. *********************
  6.  
  7.    Contents of this file:
  8.  
  9.    * Downloading GPC sources or binaries
  10.  
  11.    * Installation instructions for a GPC binary distribution
  12.  
  13.    * Compilation of the source distribution on a Unix system
  14.  
  15.    * Compilation notes for specific platforms
  16.  
  17.    * Building and installing a cross-compiler
  18.  
  19.    * Crossbuilding a compiler
  20.  
  21.    * Getting help
  22.  
  23. Where and what to download
  24. ==========================
  25.  
  26.    The master server for GNU Pascal is
  27. `agnes.dida.physik.uni-essen.de'. Official and beta releases of the
  28. compiler with sources and binaries for many platforms as well as other
  29. GNU Pascal related files can be found in
  30.  
  31.      `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/'
  32.  
  33.    You can find binary distributions for many platforms in the
  34. subdirectory `binary'. The archive files are named
  35. `gpc-VERSION.PLATFORM.EXTENSION' - for example
  36. `gpc-2.1.alpha-unknown-linux-gnu.tar.gz' for GPC version 2.1 on an
  37. Alpha workstation running the Linux kernel with GNU C Library, or
  38. `gpc-20000616.i586-pc-djgppv201.zip' for GPC version 20000616 on an
  39. i586 PC running DOS with DJGPP version 2.01.
  40.  
  41.    After you have downloaded the correct archive file for your
  42. platform, please read the installation notes on how to install such a
  43. binary distribution.
  44.  
  45.    If you are running Dos or MS Windows, you will need additional tools
  46. - see "What else to download and where" below.
  47.  
  48. Current snapshots
  49. -----------------
  50.  
  51.    GNU Pascal is subject to steady development. You can download the
  52. current snapshot (source only, use at your own risk) via anonymous FTP
  53. from:
  54.  
  55.      `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/alpha/'
  56.  
  57. or via anonymous CVS from:
  58.  
  59.      CVS root:
  60.        :pserver:anonymous@agnes.dida.physik.uni-essen.de:/usr/local/cvsroot
  61.      Password:
  62.        anonymous
  63.      Command:
  64.        checkout gpc
  65.  
  66.    Please read the installation notes on how to compile the source from
  67. a distribution or a CVS checkout.
  68.  
  69. What else to download and where
  70. -------------------------------
  71.  
  72.    When you are using GNU Pascal on a DOS system, you will need either
  73. the DJGPP or the EMX development environment (see below). On an OS/2
  74. system, you will need EMX. On an MS Windows 95/98/NT system you will
  75. need either the CygWin or the mingw32 environment.
  76.  
  77.    GNU Pascal uses the compiler back-end from the GNU Compiler
  78. Collection, GNU CC or GCC. If you want to compile GPC, you will need
  79. the source of GCC, version version 2.95.x, as well as the source of GPC
  80. itself. Please download it from the same place as GPC, or from any GNU
  81. FTP mirror. (See the list on the GNU home page,
  82. `http://www.gnu.org/gnu/order/ftp.html', for the site closest to you.)
  83.  
  84. Libraries
  85. ---------
  86.  
  87.    For some of GPC's units, you will need some standard libraries. In
  88. particular:
  89.  
  90. Unit             Platform              Library
  91. CRT              Unix/terminal         ncurses >= 5.0 (1), (2)
  92. CRT              Unix/X11              PDCurses (2)
  93. CRT              Dos, MS-Windows       PDCurses (3)
  94. GMP              any                   gmp
  95. RegEx            any                   rx
  96. (debugging)      Unix, MS-Windows      ElectricFence (4)
  97.  
  98.    Notes:
  99.  
  100.    (1) ncurses version 5.0 or newer is strongly recommended because
  101. older versions contain a bug that severely affects CRT programs.
  102.  
  103.    (2) You can install both ncurses and PDCurses on a Unix system, and
  104. choose at compile time whether to generate a terminal or X11 version of
  105. your program.
  106.  
  107.    (3) ncurses also runs under MS-Windows with CygWin (not mingw32,
  108. however), but doesn't appear to behave much differently from PDCurses
  109. on that platform.
  110.  
  111.    (4) ElectricFence is not used by any unit, but can be used for
  112. debugging memory allocation bugs by simply linking it (see the
  113. accompanying documentation).
  114.  
  115.    You can find those libraries on many places on the Net. Also, many
  116. GNU/Linux distributions, DJGPP mirrors and other OS distributions
  117. already contain some of the libraries. In any case, you can find the
  118. sources of the libraries (sometimes together with patches that you
  119. should apply before building if you choose to build from the sources)
  120. and binaries for some platforms in
  121.  
  122.      `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/libs/'
  123.  
  124. DJGPP
  125. -----
  126.  
  127.    DJGPP (http://www.delorie.com/djgpp/) is available from any SimTel
  128. mirror in the `gnu/djgpp' subdirectory; for FTP addresses look into the
  129. DJGPP FAQ (http://www.delorie.com/djgpp/v2faq/). For using GNU Pascal
  130. you need at least
  131.  
  132.    - the C library, `v2/djdev201.zip', and
  133.  
  134.    - `binutils' (assembler, etc.), `v2gnu/bnu270b.zip'.
  135.  
  136.    We also recommend you to get:
  137.  
  138.    - the `make' utility, `v2gnu/mak375b.zip'
  139.  
  140.    - the GNU debugger, `v2gnu/gdb416b.zip'
  141.  
  142.    - the DJGPP FAQ, `v2faq/faq211b.zip'
  143.  
  144.    - the GRX graphics library, `http://www.gnu.de/software/GRX/'
  145.  
  146.    - PENG, `http://fjf.gnu.de/peng.html', an integrated development
  147.      environment, similar to BP's one, written in GNU Pascal, or
  148.  
  149.    - RHIDE, `v2app/rhide.zip', another integrated development
  150.      environment.
  151.  
  152. EMX
  153. ---
  154.  
  155.    EMX is an environment for creating 32-bit applications for DOS and
  156. OS/2.  It is available from:
  157.  
  158.      `http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.html'
  159.  
  160.    To develop EMX programs with GNU Pascal you need at least
  161.  
  162.    - the EMX runtime package, `emxrt.zip',
  163.  
  164.    - the EMX development system, `emxdev*.zip', and
  165.  
  166.    - the GNU development tools, `gnudev*.zip'.
  167.  
  168.    If your DOS box has DPMI (it does if you are using MS Windows or
  169. OS/2) you will also need RSX, available from the same sites as EMX in
  170. the subdirectory `rsxnt'.
  171.  
  172.    The GNU development tools contain the GNU C compiler which is in fact
  173. not needed to use GNU Pascal. However, the C library _is_ needed.
  174.  
  175. CygWin
  176. ------
  177.  
  178.    CygWin is an environment which implements a POSIX layer under MS
  179. Windows, giving it large parts of the functionality of Unix. CygWin
  180. contains development tools such as an assembler, a linker, etc. GPC
  181. needs for operation. More information about CygWin can be found at:
  182.  
  183.      `http://www.cygnus.com/cygwin/'
  184.  
  185. mingw32
  186. -------
  187.  
  188.    The Minimalists' GNU Win32 environment, mingw32, allows a large
  189. number of Unix programs - including GPC and GCC - to run under MS
  190. Windows 95/98/NT using native MS libraries. mingw32 ressources can be
  191. found at:
  192.  
  193.      `http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/'
  194.      `http://www.xraylith.wisc.edu/~khan/software/gnu-win32/'
  195.  
  196. Installation instructions for a GPC binary distribution
  197. =======================================================
  198.  
  199.    To install a binary distribution, `cd' to the root directory and
  200. unpack the archive while preserving the stored directory structure.
  201. Under a Unix compatible system with GNU `tar' installed, the following
  202. (performed as `root') will do the job:
  203.  
  204.      # cd /
  205.      # tar xzf ARCHIVE.tar.gz
  206.  
  207.    If you are using a `tar' utility other than GNU `tar', it might be
  208. necessary to do the above in an explicit pipe:
  209.  
  210.      # cd /
  211.      # gzip -c -d ARCHIVE.tar.gz | tar xf -
  212.  
  213.    If you want to install a GPC binary distribution in another directory
  214. than it was prepared for (for example, if you do not have root access
  215. to the computer and want to install GPC somewhere under your home
  216. directory), you can do the following:
  217.  
  218.    - Unpack the archive file in a directory of your choice (see above).
  219.  
  220.    - `cd' to the "prefix" directory of the distribution (for instance
  221.      `usr/local').
  222.  
  223.    - Run the script `install-gpc-binary', available from
  224.      `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/current/binary/'.
  225.  
  226.    - Follow the instructions in the script.
  227.  
  228.    To install a ZIP archive under DOS with `PKunzip', `cd' the the
  229. appropriate directory (usually `\' for EMX, `\DJGPP' for DJGPP), then
  230. call `PKunzip' with the `-d' option:
  231.  
  232.      C:\> cd djgpp
  233.      C:\DJGPP> pkunzip -d ARCHIVE.zip
  234.  
  235.    where `ARCHIVE.zip' is the name of the distribution file.
  236.  
  237.    For DJGPP you must edit your `djgpp.env' in the `DJGPP' directory to
  238. complete the installation: Please copy the entries from `[gcc]' to
  239. create a new `[gpc]' section. The result may look as follows:
  240.  
  241.      [gcc]
  242.      COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
  243.      LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib
  244.      
  245.      [gpc]
  246.      COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
  247.      LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib
  248.  
  249.    If you are using the DJGPP version of GPC but do not have a `DJGPP'
  250. directory, please download and install DJGPP (see above).
  251.  
  252.    Binary distributions include `libgcc.a' and `specs', files that are
  253. normally part of GCC. If you have GCC installed, they will be replaced
  254. unless you manually install the archive.
  255.  
  256. Compiling GPC
  257. =============
  258.  
  259.    The preferred way to distribute GNU software is distribution of the
  260. source code. However, it can be a non-trivial exercise to build GNU
  261. Pascal on some non-Unix systems, so we also provide ready-to-run
  262. binaries for a number of platforms. (See above for how to install a
  263. binary distribution.)
  264.  
  265.    GPC is based on the GNU Compiler Collection, GNU CC or GCC. You will
  266. need the GCC sources to build it. It must be the same version as the
  267. one GPC is implemented with - `version 2.95.x' as of this writing.
  268. Although you need GCC to build the GNU Pascal compiler, you don't need
  269. GCC to compile Pascal programs once GNU Pascal is installed. (However,
  270. using certain libraries will require compiling C wrappers, so it is a
  271. good idea to install the C compiler as well.)
  272.  
  273.    Because GNU Pascal shares its back-end with GCC, it should run on any
  274. system supported by GCC. A full list of platforms supported by GCC can
  275. be found in the GCC installation instructions.
  276.  
  277.    The GCC source can be obtained from any mirror of the GNU FTP site,
  278. `ftp://ftp.gnu.org/gnu/gcc/'. The "core" distribution is sufficient for
  279. GPC.
  280.  
  281.    Here is the generic procedure for installing GNU Pascal on a Unix
  282. system. See below for extra information needed to install GPC on
  283. DOS-like platforms.
  284.  
  285.   1. Checking the prerequisites
  286.  
  287.      Make sure that GNU make is installed. (In the following, we will
  288.      simply speak of `make' when invoking GNU make; you might need to
  289.      call `gmake' instead.)
  290.  
  291.      For extracting the example programs from the documentation to the
  292.      `doc/docdemos' directory a non-crippled `sed' is needed.  GNU sed
  293.      is known to work.
  294.  
  295.      If you have checked out the GPC source from CVS, you will have to
  296.      rebuild most derived files, so you will need additional tools:
  297.      `bison', `flex', `makeinfo', `gperf', and `autoconf'. Make sure
  298.      that these are installed.
  299.  
  300.      If you want to build the GPC WWW pages you will also need:
  301.      `texi2html' version 1.61 (older versions are missing some needed
  302.      features; newer versions suffer from a bug), `texi2dvi', TeX,
  303.      `gzip', `dvips', `dviselect', and `dviconcat'.
  304.  
  305.      If you run into trouble during the installation process, please
  306.      check whether you are using outdated versions of the required
  307.      utilities and upgrade if necessary.
  308.  
  309.      The GNU versions of the packages above are available from the GNU
  310.      FTP server (ftp://ftp.gnu.org) or any of its mirrors.  Package
  311.      PACKAGE is usually located in the directory `gnu/PACKAGE'.
  312.  
  313.   2. Unpacking the source
  314.  
  315.      From a directory of your choice (e.g. `/home/fred'), unpack the
  316.      GCC and GNU Pascal source distributions. This will create separate
  317.      subdirectories for GCC and GPC. Let us assume `gcc-2.95.1' and
  318.      `gpc-20000535' in this example.
  319.           % cd /home/fred
  320.           % gzip -c -d gcc-core-2.95.1.tar.gz | tar xf -
  321.           % gzip -c -d gpc-20000535.tar.gz | tar xf -
  322.  
  323.      `cd' to the GPC directory and move the contents (a subdirectory
  324.      `p') to the subdirectory `gcc' of the GCC directory:
  325.  
  326.           % cd /home/fred/gpc-20000535
  327.           % mv p /home/fred/gcc-2.95.1/gcc/
  328.  
  329.      It is recommended, though not required, to use a separate
  330.      directory for building the compiler, rather than compiling in the
  331.      source directory. In this example, let us create
  332.      `/home/fred/gpc-build' for this purpose:
  333.  
  334.           % mkdir /home/fred/gpc-build
  335.  
  336.      If you use a separate directory, you do not need to write into the
  337.      GCC source directory once you have patched the GCC source (see
  338.      below), and can build GPC for more than one platform from the same
  339.      source tree.
  340.  
  341.      In case you are re-using a directory where you have already built
  342.      GCC and/or GPC for a different target machine, do `make distclean'
  343.      to delete all files that might be invalid. One of the files this
  344.      deletes is `Makefile'; if `make distclean' complains that
  345.      `Makefile' does not exist, it probably means that the directory is
  346.      already suitably clean.
  347.  
  348.   3. Configuring and building GCC
  349.  
  350.      GNU Pascal is automatically configured with GCC. Configuration of
  351.      GCC is treated in depth in the GCC installation instructions. The
  352.      normal procedure is as follows:
  353.  
  354.      `cd' to the GPC build directory. From there, run the `configure'
  355.      script in the GCC source directory:
  356.  
  357.           % cd /home/fred/gpc-build
  358.           % /home/fred/gcc-2.95.1/configure --enable-languages=pascal
  359.  
  360.      This creates all the necessary config files, links and Makefile in
  361.      the GCC object directory.
  362.  
  363.      Note 1: The configuration will prompt you for patching the GCC
  364.      source for GPC support, so you need write access to that
  365.      directory. All changes to GCC are surrounded by `#ifdef GPC ...
  366.      #endif', so they should not interfere when you build a C compiler
  367.      from this source tree.
  368.  
  369.      Note 2: The `--enable-languages=pascal' option means that we only
  370.      want to build the Pascal compiler and not, for instance, the C++
  371.      compiler.
  372.  
  373.      Note 3: The standard base directory for installing GCC and GPC is
  374.      `/usr/local'. If you want to install files to an alternate
  375.      directory DIR, specify `--prefix=DIR' when you run `configure'.
  376.  
  377.   4. Putting other GNU tools in place
  378.  
  379.      Some environments require other GNU tools (such as the GNU
  380.      assembler or linker) instead of the standard system tools for GCC
  381.      to work. (See the GCC installation instructions for details.) If
  382.      this is the case for your system, install the required tools in
  383.      the GPC build directory under the names `as', `ld', or whatever is
  384.      appropriate. This will enable the compiler to find the proper
  385.      tools for compilation of the program `enquire' (a part of GCC) and
  386.      to install the GNU tools to a place where they are found by GCC
  387.      but do not interfere with the standard system tools.
  388.  
  389.      Alternatively, you can do subsequent compilation using a value of
  390.      the `PATH' environment variable such that the necessary GNU tools
  391.      come before the standard system tools.
  392.  
  393.   5. Compiling GPC
  394.  
  395.      Once you are satisfied with the configuration as determined by
  396.      `configure', you can build the compiler:
  397.  
  398.           % make
  399.  
  400.      Notice that this procedure will build the C compiler (and maybe
  401.      some other compilers) too, because that is used to compile the GPC
  402.      runtime library.
  403.  
  404.      Optionally, you may supply CFLAGS, LDFLAGS or RTSFLAGS. CFLAGS is
  405.      used for compiler and RTS, RTSFLAGS are for RTS only, i.e.: `make
  406.      CFLAGS="-O2" RTSFLAGS=-Wall'
  407.  
  408.   6. Completing the installation
  409.  
  410.      When everything has been compiled, you can check the installation
  411.      process with:
  412.  
  413.           % make -n install
  414.  
  415.      To complete the installation, run the command `make install'. You
  416.      need write access to the target directories (`/usr/local/bin',
  417.      `/usr/local/lib', `/usr/local/info', `/usr/local/doc', and
  418.      `/usr/local/man' in this example), so this is usually done as
  419.      `root':
  420.  
  421.           % su -c "make install"
  422.  
  423.      If you want to install _only_ the Pascal compiler (for example if
  424.      you already have the correct version of GCC installed), `cd' to the
  425.      `gcc' subdirectory of the build directory (e.g.
  426.      `/home/fred/gpc-build/gcc') and run `make pascal.install'. This
  427.      installation process does *not* overwrite existing copies of
  428.      `libgcc.a' or `specs', should they exist.
  429.  
  430.      Also from the `gcc' subdirectory you can do some more "exotic"
  431.      builds. For instance, you can build the GPC WWW pages by typing
  432.      `make pascal.html' or a binary distribution by typing `make
  433.      pascal.bindist'. See the `Makefile' in that directory for more
  434.      examples.
  435.  
  436. Compilation notes for specific platforms
  437. ========================================
  438.  
  439. MS-DOS with DJGPP
  440. -----------------
  441.  
  442.    The only compiler that is capable of compiling the GNU Compiler
  443. Collection (GNU CC or GCC) under MS-DOS is GCC itself. In order to
  444. compile GPC or GCC for MS-DOS with DJGPP you will therefore need either
  445. a working copy of DJGPP installed, or you will have to cross-build from
  446. a non-MS-DOS system.
  447.  
  448.    Building GPC under MS-DOS with DJGPP follows the same scheme as
  449. building GPC under a Unix-like system: Place the `p' subdirectory in the
  450. `gcc' directory and follow the instructions for compiling GCC. This
  451. requires `bash' and many other tools installed, and you must be very
  452. careful at many places to circumvent the limitations of the DOS
  453. platform.
  454.  
  455.    Our preferred way to build GPC for DJGPP is to cross-build it from a
  456. Unix-like platform - which is much easier. For instructions, see
  457. "Cross-compilers" and "Crossbuilding" below.
  458.  
  459. MS-DOS or OS/2 with EMX
  460. -----------------------
  461.  
  462.    EMX is a free 32-bit DOS extender which adds some properties of Unix
  463. to MS-compatible DOS and IBM's OS/2 operating systems.
  464.  
  465.    As of this writing, we are not aware of current versions of GCC for
  466. EMX, and EMX support in GPC has not been maintained. Please contact us
  467. if you know about recent development in EMX and are interested in
  468. continuing EMX support in GPC.
  469.  
  470. MS Windows 95/98/NT
  471. -------------------
  472.  
  473.    There are two ports of the GNU development tools to MS Windows
  474. 95/98/NT: CygWin and mingw32.
  475.  
  476.    The CygWin environment implements a POSIX layer under MS Windows,
  477. giving it large parts of the functionality of Unix. Thus, compiling GCC
  478. and GPC under the CygWin environment can be done following the
  479. instructions for compiling it under a Unix-like system (see above).
  480.  
  481.    The Minimalists' GNU Win32 environment, mingw32, uses the native
  482. `crtdll.dll' library of MS Winodws. It is much smaller than CygWin, but
  483. it is not self-hosting and must be crossbuilt from another system (see
  484. below).
  485.  
  486. Building and Installing a cross-compiler
  487. ========================================
  488.  
  489.    GNU Pascal can function as a cross-compiler for many machines.
  490. Information about GNU tools in a cross-configuration can be found at
  491. `ftp://ftp.cygnus.com/pub/embedded/crossgcc/'.
  492.  
  493.    Since GNU Pascal generates assembler code, you need a cross-assembler
  494. that GNU Pascal can run, in order to produce object files. If you want
  495. to link on other than the target machine, you need a cross-linker as
  496. well. It is straightforward to install the GNU binutils to act as
  497. cross-tools - see the installation instructions of the GNU binutils for
  498. details.
  499.  
  500.    You also need header files and libraries suitable for the target
  501. machine that you can install on the host machine. Please install them
  502. under `PREFIX/PLATFORM/include/', for instance
  503. `/usr/local/i386-pc-msdosdjgpp/include/' for a cross-compiler from a
  504. typical Unix-like environmant to MS-DOS with DJGPP.
  505.  
  506.    Configuration and compilation of the compiler can then be done using
  507. the scripts `cfgpc' and `mkgpc' which are included in the source
  508. distribution in the subdirectory `p/script'. Please call them with the
  509. `-h' option for instructions.
  510.  
  511. Crossbuilding a compiler.
  512. =========================
  513.  
  514.    Using a cross-compiler to build GNU Pascal results in a compiler
  515. binary that runs on the cross-target platform. This is called
  516. "crossbuilding". A possible reason why anybody would want to do this,
  517. is when the platform on which you want to run the GNU Pascal compiler
  518. is not self-hosting. An example is mingw32.
  519.  
  520.    To crossbuild GNU Pascal, you have to install a cross-compiler for
  521. your target first, see above.
  522.  
  523.    As when building a cross-compiler, configuration and compilation of
  524. the compiler can be done using the scripts `cfgpc' and `mkgpc' which
  525. are included in the source distribution in the subdirectory `p/script'.
  526. Please call them with the `-h' option for instructions.
  527.  
  528. Getting help
  529. ============
  530.  
  531.    If you have further questions, please ask them on the GPC mailing
  532. list, <gpc@gnu.de>. To subscribe to the list, write an email containing
  533. "subscribe gpc" in the body to <majordomo@gnu.de>. (The subject will be
  534. ignored.)
  535.  
  536.    Have fun with GPC!
  537.  
  538.